import { ref } from 'vue'
import { defineStore } from 'pinia'

export const useCityStore = defineStore(
  'city',
  () => {
    /* 
        用户当前所在的city  setCity  getCity
    */
    //  TODO：改为获得当前位置
    const city = ref('宁波')
    const setCity = (newCity) => {
      city.value = newCity
    }
    return { city, setCity }
  },
  {
    persist: {
      paths: ['city']
    }
  }
)
